/*
 ============================================================================
 Name		: StraightLightContainer.h
 Author	  : 
 Version	 : 1.0
 Copyright   : Your copyright notice
 Description : CStraightLightContainer declaration
 ============================================================================
 */

#ifndef STRAIGHTLIGHTCONTAINER_H
#define STRAIGHTLIGHTCONTAINER_H

// INCLUDES
#include <coecntrl.h>

#include <HWRMLight.h>

#include "LMDebug.h"
// CLASS DECLARATION

/**
 *  CStraightLightContainer
 * 
 */
class CStraightLightContainer : public CCoeControl, MCoeControlObserver, MHWRMLightObserver
	{
public:
	enum TStrLightState
		{
		EStrLightOn = 0,
		EStrLightOff
		};
	
private:
//	enum
//	{
//	EVibraStateUnKnown = 0,
//	EVibraStateRunning,
//	EVibraStateStopped
//	};	
	
public:
	// Constructors and destructor

	/**
	 * Destructor.
	 */
	~CStraightLightContainer();

	/**
	 * Two-phased constructor.
	 */
	static CStraightLightContainer* NewL(const TRect& aRect);

	/**
	 * Two-phased constructor.
	 */
	static CStraightLightContainer* NewLC(const TRect& aRect);

private:

	/**
	 * Constructor for performing 1st stage construction
	 */
	CStraightLightContainer();

	/**
	 * EPOC default constructor for performing 2nd stage construction
	 */
	void ConstructL(const TRect& aRect);

public:
	// Functions from base classes
	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);

private:
	// Functions from base classes
	void SizeChanged();
	TInt CountComponentControls() const;
	CCoeControl* ComponentControl(TInt aIndex) const;
	void Draw(const TRect& aRect) const;
	void HandleControlEventL(CCoeControl* aControl, TCoeEvent aEventType);
	void HandlePointerEventL( const TPointerEvent& aEvent );
	void HandleResourceChange( TInt aType );
	
    // from MHWRMLightObserver
    virtual void LightStatusChanged(TInt aTarget, 
                                    CHWRMLight::TLightStatus aStatus);
    
public:
	void Light();
	
	void LightOn();
	void LightOff();

private:
	//data
	CHWRMLight*               	iLight;
	TStrLightState				iLightState;
//	TInt 						iVibraState;
	
	TRgb 						iColor;
	
	CFbsBitmap* 	iImgLight;
	CFbsBitmap*  	iImgLightGray;
	CFbsBitmap* 	iImgLightMask;
	
	};

#endif // STRAIGHTLIGHTCONTAINER_H
